package com.livew.framework.base.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.livew.framework.utils.XTStringUtils;

import java.util.List;

@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class FileEO extends BaseModel {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3244528868005779958L;

	private Long parentId;

	private String name;

	private Long caseId;

	private String caseClazz;

	private String type;

	private String srcname;

	private String uuidKey;

	private Double size;

	private String remotefilename;

	private String groupname;

	private String unit;
	
	private String filePath;
	
	private List<Long> caseIds;
	

	public Long getCaseId() {
		return caseId;
	}

	public void setCaseId(Long caseId) {
		this.caseId = caseId;
	}

	public String getCaseClazz() {
		return caseClazz;
	}

	public void setCaseClazz(String caseClazz) {
		this.caseClazz = caseClazz == null ? null : caseClazz.trim();
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type == null ? null : type.trim();
	}

	public String getSrcname() {
		return srcname;
	}

	public void setSrcname(String srcname) {
		this.srcname = srcname == null ? null : srcname.trim();
	}

	public String getUuidKey() {
		return uuidKey;
	}

	public void setUuidKey(String uuidKey) {
		this.uuidKey = uuidKey == null ? null : uuidKey.trim();
	}

	public Double getSize() {
		return size;
	}

	public void setSize(Double size) {
		this.size = size;
	}

	public String getRemotefilename() {
		return remotefilename;
	}

	public void setRemotefilename(String remotefilename) {
		this.remotefilename = remotefilename == null ? null : remotefilename.trim();
	}

	public String getGroupname() {
		return groupname;
	}

	public void setGroupname(String groupname) {
		this.groupname = groupname == null ? null : groupname.trim();
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit == null ? null : unit.trim();
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name == null ? null : name.trim();
	}

	public List<Long> getCaseIds() {
		return caseIds;
	}

	public void setCaseIds(List<Long> caseIds) {
		this.caseIds = caseIds;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	@Override
	public String getRemark2() {
		String fileName = this.getSrcname();
		if(!XTStringUtils.isEmpty(fileName)) {
		if(fileName.lastIndexOf(".jpg") == -1 && fileName.lastIndexOf(".png") == -1
                && fileName.lastIndexOf(".jpeg") == -1 && fileName.lastIndexOf(".gif") == -1
                && fileName.lastIndexOf(".bmp") == -1) {
			return "1"; //图片类型
		}
		}
		return super.getRemark2();
	}
	
}